package com.hgc.ch03;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by 01367627 on 2019/7/9.
 */
public class AtomicIntegerExample {
    public static void main(String[] args) {
        AtomicInteger ai = new AtomicInteger(100);
        System.out.println(ai.incrementAndGet());
        System.out.println(ai.compareAndSet(101,105));
        System.out.println(ai.get());
    }
}
